package com.car.main;

import java.sql.Connection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.bbs.crawl.ReplyCarwlAutoHome;
import com.bbs.dao.HuiFuDAOOfAutoHome;
import com.car.util.ConnectionPool;

public class ReplyMainOfAutoHome {
	public static void main(String[] args) {
		Connection conn = ConnectionPool.getConnection("autohome", "root", "zhouzhou100428", "localhost");
		HuiFuDAOOfAutoHome huiFuDAO = new HuiFuDAOOfAutoHome(conn);
		List<Integer> uids = huiFuDAO.getUserID();
		ExecutorService fixedThreadPool = Executors.newFixedThreadPool(30);
		for (Integer uid : uids) {
			fixedThreadPool.execute(new ReplyCarwlAutoHome(uid, huiFuDAO));
		}
		fixedThreadPool.shutdown();
	}
}
